#lang racket

(require "stream-basics.rkt")

(define (add-streams s1 s2)
  (stream-map + s1 s2))

(define ones (cons-stream 1 ones))

(define integers (cons-stream 1 (add-streams ones integers)))

;(define partial-sum (cons-stream 0 (add-streams partial-sum 1-to-10)))

(define (partial-sums stream)
  (define ps (cons-stream 0 (add-streams ps stream)))
  ps)

(display-stream (stream-take 10 (partial-sums integers)))